3.1324 \(\int (c (d \tan (e+f x))^p)^n (a+b \tan (e+f x))^3 \, dx\)

Optimal. Leaf size=219 \[ \frac{b \left (3 a^2-b^2\right ) \tan ^2(e+f x) \, _2F_1\left (1,\frac{1}{2} (n p+2);\frac{1}{2} (n p+4);-\tan ^2(e+f x)\right ) \left (c (d \tan (e+f x))^p\right )^n}{f (n p+2)}+\frac{a \left (a^2-3 b^2\right ) \tan (e+f x) \, _2F_1\left (1,\frac{1}{2} (n p+1);\frac{1}{2} (n p+3);-\tan ^2(e+f x)\right ) \left (c (d \tan (e+f x))^p\right )^n}{f (n p+1)}+\frac{3 a b^2 \tan (e+f x) \left (c (d \tan (e+f x))^p\right )^n}{f (n p+1)}+\frac{b^3 \tan ^2(e+f x) \left (c (d \tan (e+f x))^p\right )^n}{f (n p+2)} \]

[Out]

(3*a*b^2*Tan[e + f*x]*(c*(d*Tan[e + f*x])^p)^n)/(f*(1 + n*p)) + (a*(a^2 - 3*b^2)*Hypergeometric2F1[1, (1 + n*p
)/2, (3 + n*p)/2, -Tan[e + f*x]^2]*Tan[e + f*x]*(c*(d*Tan[e + f*x])^p)^n)/(f*(1 + n*p)) + (b^3*Tan[e + f*x]^2*
(c*(d*Tan[e + f*x])^p)^n)/(f*(2 + n*p)) + (b*(3*a^2 - b^2)*Hypergeometric2F1[1, (2 + n*p)/2, (4 + n*p)/2, -Tan
[e + f*x]^2]*Tan[e + f*x]^2*(c*(d*Tan[e + f*x])^p)^n)/(f*(2 + n*p))

________________________________________________________________________________________

Rubi [A]  time = 0.367151, antiderivative size = 219, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 4, integrand size = 27, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.148, Rules used = {6677, 1802, 808, 364} \[ \frac{b \left (3 a^2-b^2\right ) \tan ^2(e+f x) \, _2F_1\left (1,\frac{1}{2} (n p+2);\frac{1}{2} (n p+4);-\tan ^2(e+f x)\right ) \left (c (d \tan (e+f x))^p\right )^n}{f (n p+2)}+\frac{a \left (a^2-3 b^2\right ) \tan (e+f x) \, _2F_1\left (1,\frac{1}{2} (n p+1);\frac{1}{2} (n p+3);-\tan ^2(e+f x)\right ) \left (c (d \tan (e+f x))^p\right )^n}{f (n p+1)}+\frac{3 a b^2 \tan (e+f x) \left (c (d \tan (e+f x))^p\right )^n}{f (n p+1)}+\frac{b^3 \tan ^2(e+f x) \left (c (d \tan (e+f x))^p\right )^n}{f (n p+2)} \]

Antiderivative was successfully verified.

[In]

Int[(c*(d*Tan[e + f*x])^p)^n*(a + b*Tan[e + f*x])^3,x]

[Out]

(3*a*b^2*Tan[e + f*x]*(c*(d*Tan[e + f*x])^p)^n)/(f*(1 + n*p)) + (a*(a^2 - 3*b^2)*Hypergeometric2F1[1, (1 + n*p
)/2, (3 + n*p)/2, -Tan[e + f*x]^2]*Tan[e + f*x]*(c*(d*Tan[e + f*x])^p)^n)/(f*(1 + n*p)) + (b^3*Tan[e + f*x]^2*
(c*(d*Tan[e + f*x])^p)^n)/(f*(2 + n*p)) + (b*(3*a^2 - b^2)*Hypergeometric2F1[1, (2 + n*p)/2, (4 + n*p)/2, -Tan
[e + f*x]^2]*Tan[e + f*x]^2*(c*(d*Tan[e + f*x])^p)^n)/(f*(2 + n*p))

Rule 6677

Int[(u_)*((c_.)*((a_.) + (b_.)*(x_))^(n_))^(p_), x_Symbol] :> Dist[(c^IntPart[p]*(c*(a + b*x)^n)^FracPart[p])/
(a + b*x)^(n*FracPart[p]), Int[u*(a + b*x)^(n*p), x], x] /; FreeQ[{a, b, c, n, p}, x] &&  !IntegerQ[p] &&  !Ma
tchQ[u, x^(n1_.)*(v_.) /; EqQ[n, n1 + 1]]

Rule 1802

Int[(Pq_)*((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*Pq*(a + b*x
^2)^p, x], x] /; FreeQ[{a, b, c, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rule 808

Int[((e_.)*(x_))^(m_)*((f_) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Dist[f, Int[(e*x)^m*(a + c*
x^2)^p, x], x] + Dist[g/e, Int[(e*x)^(m + 1)*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, e, f, g, p}, x] &&  !Ration
alQ[m] &&  !IGtQ[p, 0]

Rule 364

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(a^p*(c*x)^(m + 1)*Hypergeometric2F1[-
p, (m + 1)/n, (m + 1)/n + 1, -((b*x^n)/a)])/(c*(m + 1)), x] /; FreeQ[{a, b, c, m, n, p}, x] &&  !IGtQ[p, 0] &&
 (ILtQ[p, 0] || GtQ[a, 0])

Rubi steps

\begin{align*} \int \left (c (d \tan (e+f x))^p\right )^n (a+b \tan (e+f x))^3 \, dx &=\frac{\operatorname{Subst}\left (\int \frac{\left (c (d x)^p\right )^n (a+b x)^3}{1+x^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{\left ((d \tan (e+f x))^{-n p} \left (c (d \tan (e+f x))^p\right )^n\right ) \operatorname{Subst}\left (\int \frac{(d x)^{n p} (a+b x)^3}{1+x^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{\left ((d \tan (e+f x))^{-n p} \left (c (d \tan (e+f x))^p\right )^n\right ) \operatorname{Subst}\left (\int \left (3 a b^2 (d x)^{n p}+\frac{b^3 (d x)^{1+n p}}{d}+\frac{(d x)^{n p} \left (a^3-3 a b^2+b \left (3 a^2-b^2\right ) x\right )}{1+x^2}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{3 a b^2 \tan (e+f x) \left (c (d \tan (e+f x))^p\right )^n}{f (1+n p)}+\frac{b^3 \tan ^2(e+f x) \left (c (d \tan (e+f x))^p\right )^n}{f (2+n p)}+\frac{\left ((d \tan (e+f x))^{-n p} \left (c (d \tan (e+f x))^p\right )^n\right ) \operatorname{Subst}\left (\int \frac{(d x)^{n p} \left (a^3-3 a b^2+b \left (3 a^2-b^2\right ) x\right )}{1+x^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{3 a b^2 \tan (e+f x) \left (c (d \tan (e+f x))^p\right )^n}{f (1+n p)}+\frac{b^3 \tan ^2(e+f x) \left (c (d \tan (e+f x))^p\right )^n}{f (2+n p)}+\frac{\left (a \left (a^2-3 b^2\right ) (d \tan (e+f x))^{-n p} \left (c (d \tan (e+f x))^p\right )^n\right ) \operatorname{Subst}\left (\int \frac{(d x)^{n p}}{1+x^2} \, dx,x,\tan (e+f x)\right )}{f}+\frac{\left (b \left (3 a^2-b^2\right ) (d \tan (e+f x))^{-n p} \left (c (d \tan (e+f x))^p\right )^n\right ) \operatorname{Subst}\left (\int \frac{(d x)^{1+n p}}{1+x^2} \, dx,x,\tan (e+f x)\right )}{d f}\\ &=\frac{3 a b^2 \tan (e+f x) \left (c (d \tan (e+f x))^p\right )^n}{f (1+n p)}+\frac{a \left (a^2-3 b^2\right ) \, _2F_1\left (1,\frac{1}{2} (1+n p);\frac{1}{2} (3+n p);-\tan ^2(e+f x)\right ) \tan (e+f x) \left (c (d \tan (e+f x))^p\right )^n}{f (1+n p)}+\frac{b^3 \tan ^2(e+f x) \left (c (d \tan (e+f x))^p\right )^n}{f (2+n p)}+\frac{b \left (3 a^2-b^2\right ) \, _2F_1\left (1,\frac{1}{2} (2+n p);\frac{1}{2} (4+n p);-\tan ^2(e+f x)\right ) \tan ^2(e+f x) \left (c (d \tan (e+f x))^p\right )^n}{f (2+n p)}\\ \end{align*}

Mathematica [A]  time = 0.889318, size = 163, normalized size = 0.74 \[ \frac{\tan (e+f x) \left (c (d \tan (e+f x))^p\right )^n \left (a \left (a^2-3 b^2\right ) (n p+2) \, _2F_1\left (1,\frac{1}{2} (n p+1);\frac{1}{2} (n p+3);-\tan ^2(e+f x)\right )+b \left (\left (3 a^2-b^2\right ) (n p+1) \tan (e+f x) \, _2F_1\left (1,\frac{n p}{2}+1;\frac{n p}{2}+2;-\tan ^2(e+f x)\right )+b (3 a (n p+2)+b (n p+1) \tan (e+f x))\right )\right )}{f (n p+1) (n p+2)} \]

Antiderivative was successfully verified.

[In]

Integrate[(c*(d*Tan[e + f*x])^p)^n*(a + b*Tan[e + f*x])^3,x]

[Out]

(Tan[e + f*x]*(c*(d*Tan[e + f*x])^p)^n*(a*(a^2 - 3*b^2)*(2 + n*p)*Hypergeometric2F1[1, (1 + n*p)/2, (3 + n*p)/
2, -Tan[e + f*x]^2] + b*((3*a^2 - b^2)*(1 + n*p)*Hypergeometric2F1[1, 1 + (n*p)/2, 2 + (n*p)/2, -Tan[e + f*x]^
2]*Tan[e + f*x] + b*(3*a*(2 + n*p) + b*(1 + n*p)*Tan[e + f*x]))))/(f*(1 + n*p)*(2 + n*p))

________________________________________________________________________________________

Maple [F]  time = 0.637, size = 0, normalized size = 0. \begin{align*} \int \left ( c \left ( d\tan \left ( fx+e \right ) \right ) ^{p} \right ) ^{n} \left ( a+b\tan \left ( fx+e \right ) \right ) ^{3}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c*(d*tan(f*x+e))^p)^n*(a+b*tan(f*x+e))^3,x)

[Out]

int((c*(d*tan(f*x+e))^p)^n*(a+b*tan(f*x+e))^3,x)

________________________________________________________________________________________

Maxima [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*(d*tan(f*x+e))^p)^n*(a+b*tan(f*x+e))^3,x, algorithm="maxima")

[Out]

Timed out

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left ({\left (b^{3} \tan \left (f x + e\right )^{3} + 3 \, a b^{2} \tan \left (f x + e\right )^{2} + 3 \, a^{2} b \tan \left (f x + e\right ) + a^{3}\right )} \left (\left (d \tan \left (f x + e\right )\right )^{p} c\right )^{n}, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*(d*tan(f*x+e))^p)^n*(a+b*tan(f*x+e))^3,x, algorithm="fricas")

[Out]

integral((b^3*tan(f*x + e)^3 + 3*a*b^2*tan(f*x + e)^2 + 3*a^2*b*tan(f*x + e) + a^3)*((d*tan(f*x + e))^p*c)^n,
x)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (c \left (d \tan{\left (e + f x \right )}\right )^{p}\right )^{n} \left (a + b \tan{\left (e + f x \right )}\right )^{3}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*(d*tan(f*x+e))**p)**n*(a+b*tan(f*x+e))**3,x)

[Out]

Integral((c*(d*tan(e + f*x))**p)**n*(a + b*tan(e + f*x))**3, x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (b \tan \left (f x + e\right ) + a\right )}^{3} \left (\left (d \tan \left (f x + e\right )\right )^{p} c\right )^{n}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*(d*tan(f*x+e))^p)^n*(a+b*tan(f*x+e))^3,x, algorithm="giac")

[Out]

integrate((b*tan(f*x + e) + a)^3*((d*tan(f*x + e))^p*c)^n, x)